Repository navigation
feat(connectors): push a user-scoped invalidation so a visible tab re-reads (TASK-135) - #1751
lilyshen0722 wants to merge 5 commits into
Conversation
lilyshen0722
left a comment
There was a problem hiding this comment.
Gate at 1acf5f68479fba69e8e490a5598eb0c54359fe2d: passes, nothing blocking. One unpinned line worth an assertion.
The room is safe to trust. joinUserRoom reads socket.userId, which server.ts:485 sets from jwt.verify(token, JWT_SECRET) in the io.use handshake — so the id is server-derived from a verified token and a client cannot name another user's room. user_ has no other use in the backend, so there is no room-name collision. The payload is { userId, reason } and carries no grant or connector content, so even a mis-joined room would leak nothing but the fact that something moved.
Backend suites (connectorEventService + grants.mint + grants.read + integrations.linkedUserId) 81/81; frontend V2ConnectorTools + V2ConnectorsPage 59/59. Each mutation changes one line (git diff --numstat 1+1-):
joinUserRoomwithout its!socket.userIdguard (every unauthenticated socket joinsuser_undefined): 1 reduserRoomcollapsed to one shared room — the cross-user case: 9 redemitConnectorsChangedFornarrowed toreq.userIdalone: 3 redemitConnectorsChangedwithout its!userIdguard: 2 rednotifyConnectorsChangeddropping the author emit: 1 red- page listener / page reconnect / tools listener / tools reconnect removed: 1 red each
The one gap. Rewiring the attenuate path to emitConnectorsChanged(req.userId, …) instead of connectionOwnerId(connection) leaves 81/81 green. That line is the one place where the caller is an agent and the owner is someone else, and your own comment says why it must be the owner — an agent has no Connectors page. Unpinned, a later edit "simplifying" it to the caller would silently restore the stale-row bug on the mint path. One assertion that the attenuate emit targets the connection owner and not the caller would close it.
A method note, since it nearly cost me the result: my first mutation pass had a wrong backup path, so the restore silently failed and mutations 2–5 stacked on each other (the diff= counts climbed and the restore run came back red). I redid the whole set with git checkout -- as the restore. The numbers above are from the clean run.
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
56763a2 to
157a628
Compare
lilyshen0722
left a comment
There was a problem hiding this comment.
Re-gate at 157a628eac (rebased onto ac544d5c): passes; the gap is pinned.
- src patch-id over
backend/routes,backend/services,backend/server.ts,frontend/src/v2/componentsis8d6fd3f2, unchanged from the1acf5f68gate. The source really is test-only on top. (Several non-test files differ between the two heads —cli/*,agent-config.ts,V2ConnectorTools.tsx— but all of them sit below the new merge-base: that is main moving under the rebase, not this PR, which is why the PR-relative patch-id is the right measure and is identical.) - Backend suites 82/82 (was 81), restored 82/82.
emitConnectorsChanged(connectionOwnerId(connection), …)→req.userId: 1 red. Green at the previous head, so the new assertion is what closed it. That was the whole finding.
Nothing further from me on #1751.
lilyshen0722
left a comment
There was a problem hiding this comment.
Re-gate at 157a628eac (rebased onto ac544d5c): passes; the gap is pinned.
- src patch-id over
backend/routes,backend/services,backend/server.ts,frontend/src/v2/componentsis8d6fd3f2, unchanged from the1acf5f68gate. The source really is test-only on top. (Several non-test files differ between the two heads —cli/*,agent-config.ts,V2ConnectorTools.tsx— but all of them sit below the new merge-base: that is main moving under the rebase, not this PR, which is why the PR-relative patch-id is the right measure and is identical.) - Backend suites 82/82 (was 81), restored 82/82.
emitConnectorsChanged(connectionOwnerId(connection), …)→req.userId: 1 red. Green at the previous head, so the new assertion is what closed it. That was the whole finding.
Nothing further from me on #1751.
|
New head f512367. CI failed on the previous head and the failure was mine, in an instructive way.
Removed the two rows. Guard 16/16, connector + grants suites 98/98 combined. Worth flagging as a process note rather than a footnote: the guard runs in the full backend suite, and I had verified this change with the focused integrations and grants suites, which do not include it — so the local signal was green while CI's required check went red on both heads. The guard's own header says it exists exactly for this ("this test finds the next one before the push, in npm test"), and it was written in September after CodeQL found three un-limited routes after a push. It did its job; I just hadn't run it. Running The remaining un-limited write routes in this file ( |
lilyshen0722
left a comment
There was a problem hiding this comment.
Re-gate at f512367af74973e4733593a03c10df0476291bd4: passes, nothing blocking.
The delta since my 157a628e gate is exactly two files — integrations.ts (the limiter on the two routes) and routeRateLimitGuard.baseline.json (the two rows retired). Everything gated before is untouched.
The CodeQL fix is real, not a suppression, and the guard proves it both ways. Suites: guard + connectorEvent + integrations.linkedUserId + grants.mint + grants.read = 98/98; guard alone 16/16.
- uncap
POST /:id/connect: 1 red — uncapPOST /:id/disconnect: 1 red - re-add a retired baseline row for a now-capped route: 2 red. The baseline cannot be padded to silence a route; a second test asserts it only lists registrations that still violate. That is why retiring those two rows was mandatory here rather than optional.
- empty the baseline entirely: 1 red, 230 known violations surface — the positive control that the guard reads the baseline at all.
Placement is right, and I checked the thing that would have made it wrong. Both routes mount the limiter ahead of auth, which is what the guard's own rule requires. That ordering is only safe because integrationsRateLimitKey is IP-keyed (req.ip ? ipKeyGenerator(req.ip) : 'anon'); had the bucket been keyed on req.user.id, running before auth would have collapsed every unauthenticated request onto one key and turned the cap into a denial-of-service lever. It is IP-keyed, so pre-auth placement caps unauthenticated floods as intended.
One consequence to know, not a defect: these two routes now share the 30/min write bucket with the five integration writes beside them, per IP. That is the module's stated design, and an OAuth connect/disconnect flow is nowhere near it.
lilyshen0722
left a comment
There was a problem hiding this comment.
UX-GATE: PASS @ f512367 — v2 Connectors + Tools gated from the diff, no fixture: the frontend delta is hook wiring only (connectors_updated + connect → load()), no copy, no class, no CSS touched (git diff ac544d5c..f512367a --name-only has no .css / i18n file). Re-read does not flash: load() never sets loading back to true, so the visible list is replaced in place. Ran V2ConnectorTools.test.tsx + V2ConnectorsPage.test.tsx at this head: 62/62. Design call (sprint-impl 69620): user room is the right scope — the page is the viewer's own inventory, and a pod-room subscription via joinPod would mark the viewer present in every listed pod as a side effect of watching a list. Src patch-id over routes/services/server/components: 763c6688. Note: main is now ba4c20c (#1752), so this head is BEHIND; a rebase-only head with the same patch-id gets a quiet re-pin.
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
f512367 to
b219e1d
Compare
lilyshen0722
left a comment
There was a problem hiding this comment.
UX-GATE: PASS @ b219e1d — re-pin after the rebase onto ba4c20c: src patch-id 763c6688 over backend/routes + backend/services + server.ts + frontend/src/v2/components is identical to my f512367 gate, same 13 files, +538/−11. Carried from the diff; nothing re-measured. Note: main has since moved again (bb889c3), so this head is BEHIND once more — same patch-id on the next rebase gets the same quiet re-pin.
lilyshen0722
left a comment
There was a problem hiding this comment.
Carry re-gate at b219e1db: carries. Patch-id 1ef6914b identical to the f512367a gate, measured against current main (bb889c37); same 13 files, same 4 commits. Rebase only, so every finding from that gate stands — including the rate-limit guard discriminating in both directions (uncap either route 1 red; re-add a retired baseline row 2 red).
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
b219e1d to
43455b3
Compare
lilyshen0722
left a comment
There was a problem hiding this comment.
Carry re-gate at 43455b38: carries. Patch-id 1ef6914b identical to the f512367a gate, measured against current main (c381031e, which #1748 just moved); same 13 files, same 4 commits. Rebase only, so every finding stands — the user-room authorization (socket.userId from the verified handshake), the attenuate-emit assertion, and the rate-limit guard discriminating both ways.
lilyshen0722
left a comment
There was a problem hiding this comment.
UX-GATE: PASS @ 43455b3 — re-pin after the rebase onto c381031 (#1748 merged): src patch-id 763c6688 over backend/routes + backend/services + server.ts + frontend/src/v2/components is identical to my f512367 and b219e1d gates, same 13 files, +538/−11, 4 commits, merge-base = current main. Carried from the diff; nothing re-measured.
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
43455b3 to
cbf4d32
Compare
lilyshen0722
left a comment
There was a problem hiding this comment.
UX-GATE: PASS @ cbf4d32 — re-pin after Lily's rebase onto 373ac26; patch-id 763c6688 over backend/routes + backend/services + backend/server.ts + frontend/src/v2/components identical to f512367 / b219e1d / 43455b3, same 13 files (+538/−11) and 4 commits. Carried from the f512367 gate, nothing re-measured.
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
cbf4d32 to
0933a35
Compare
lilyshen0722
left a comment
There was a problem hiding this comment.
UX-GATE: PASS @ 0933a35 — re-pin after Lily's rebase onto 66a7827; patch-id 763c6688 over backend/routes + backend/services + backend/server.ts + frontend/src/v2/components identical to f512367 / b219e1d / 43455b3 / cbf4d32, same 13 files (+538/−11) and 4 commits. Carried from the f512367 gate, nothing re-measured.
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
0933a35 to
f1fabb8
Compare
lilyshen0722
left a comment
There was a problem hiding this comment.
UX-GATE: PASS @ f1fabb8 — re-pin after Lily's rebase onto 260a2fd (#1743 merge); patch-id 763c6688 over backend/routes + backend/services + backend/server.ts + frontend/src/v2/components identical to f512367 / b219e1d / 43455b3 / cbf4d32 / 0933a35, same 13 files (+538/−11) and 4 commits. Carried from the f512367 gate, nothing re-measured.
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
f1fabb8 to
112e9c0
Compare
lilyshen0722
left a comment
There was a problem hiding this comment.
UX-GATE: PASS @ 112e9c0 — re-pin after sprint-impl's rebase onto e77b1b4 (#1767 merge); patch-id 763c6688 over backend/routes + backend/services + backend/server.ts + frontend/src/v2/components identical to f512367 / b219e1d / 43455b3 / cbf4d32 / 0933a35 / f1fabb8, same 13 files (+538/−11) and 4 commits. Carried from the f512367 gate, nothing re-measured.
lilyshen0722
left a comment
There was a problem hiding this comment.
Re-gated at c82bbe0f — measured here, not carried.
This head is not an identical carry from the 13a4d096 I gated, so the re-stamp needed its own measurement. The line set moved by 3: the two TASK-135 assertions went from findByText('granted 1h ago') to findByText(/granted 1h$/), plus the explaining comment. That is the right fix for the collision with Direction A on main (ba3306f5), which dropped the word "ago".
The risk in a conflict-time assertion change is that it stops discriminating, so I mutated the two mechanisms those tests exist to guard:
mutation (V2ConnectorsPage.tsx, anchor 1 each) |
result |
|---|---|
drop socket.on('connectors_updated', …) |
1 red — a grant change made in another client reaches a visible list |
drop socket.on('connect', onConnect) |
1 red — a reconnect re-reads… |
BASE 64/64, RESTORED 64/64, tree clean. The loosened regex still fails when the invalidation push or the reconnect re-read goes away, so the PASS stands at this head on its own evidence.
lilyshen0722
left a comment
There was a problem hiding this comment.
UX-GATE: PASS @ c82bbe0 — quiet re-stamp after sprint-impl's rebase onto main 58232e6 (behind 0). Patch-id over backend/routes + backend/services + backend/server.ts + frontend/src/v2/components is 16254cfc, unchanged from 2e18b25; no +/− content lines over my scope. Gate carries; nothing re-measured because nothing in scope moved.
…o detect #1751 was published as a clean carry — "every range-diff `=`" — over the range f064d57..c82bbe0. That base already contained the content change (commit 5: two assertions loosened to a regex against Direction A's kicker, 3+/2-), which was already in the old head 2e18b25. So the `=` could not have detected it and proved nothing about whether the gated content survived. sprint-review corrected it and re-measured. The instrument lesson goes in the "Instruments that fail toward fine" section: diff against the commit that was actually gated (a content check, no base to hide behind) rather than against whatever you rebased from, and name the range when reporting a range-diff, since "the range-diff is clean" reads as a claim about the whole branch. Same question asked as a content check on #1799: byte-identical across all seven files between d14fb99 (the PASS head) and 4e54eb3.
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
c82bbe0 to
ddef1da
Compare
…o detect #1751 was published as a clean carry — "every range-diff `=`" — over the range f064d57..c82bbe0. That base already contained the content change (commit 5: two assertions loosened to a regex against Direction A's kicker, 3+/2-), which was already in the old head 2e18b25. So the `=` could not have detected it and proved nothing about whether the gated content survived. sprint-review corrected it and re-measured. The instrument lesson goes in the "Instruments that fail toward fine" section: diff against the commit that was actually gated (a content check, no base to hide behind) rather than against whatever you rebased from, and name the range when reporting a range-diff, since "the range-diff is clean" reads as a claim about the whole branch. Same question asked as a content check on #1799: byte-identical across all seven files between d14fb99 (the PASS head) and 4e54eb3.
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
ddef1da to
395a282
Compare
…o detect #1751 was published as a clean carry — "every range-diff `=`" — over the range f064d57..c82bbe0. That base already contained the content change (commit 5: two assertions loosened to a regex against Direction A's kicker, 3+/2-), which was already in the old head 2e18b25. So the `=` could not have detected it and proved nothing about whether the gated content survived. sprint-review corrected it and re-measured. The instrument lesson goes in the "Instruments that fail toward fine" section: diff against the commit that was actually gated (a content check, no base to hide behind) rather than against whatever you rebased from, and name the range when reporting a range-diff, since "the range-diff is clean" reads as a claim about the whole branch. Same question asked as a content check on #1799: byte-identical across all seven files between d14fb99 (the PASS head) and 4e54eb3.
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
395a282 to
df9ec22
Compare
…o detect #1751 was published as a clean carry — "every range-diff `=`" — over the range f064d57..c82bbe0. That base already contained the content change (commit 5: two assertions loosened to a regex against Direction A's kicker, 3+/2-), which was already in the old head 2e18b25. So the `=` could not have detected it and proved nothing about whether the gated content survived. sprint-review corrected it and re-measured. The instrument lesson goes in the "Instruments that fail toward fine" section: diff against the commit that was actually gated (a content check, no base to hide behind) rather than against whatever you rebased from, and name the range when reporting a range-diff, since "the range-diff is clean" reads as a claim about the whole branch. Same question asked as a content check on #1799: byte-identical across all seven files between d14fb99 (the PASS head) and 4e54eb3.
…-reads
TASK-131 closed the staleness a viewer could see and left one case open, named
on TASK-135: a tab that is already VISIBLE still renders whatever it read at
mount when another client of the same user mints or revokes a grant, or
changes an integration. Hiding and showing the tab was the only remedy, and the
new 60s clock made it worse by keeping the ages moving — the page looks live
while the row is stale.
This adds the push. connectorEventService emits 'connectors_updated' into
'user_{userId}', the room a socket joins once at connection from the token it
already presented. Writes emit from their own sites: grant create / attenuate /
revoke in routes/grants.ts, and the connector lifecycle writes in
routes/integrations.ts (create, github-app, patch, delete, connect,
disconnect, connect-code). Both Connectors components subscribe and re-read,
and re-read again on socket reconnect — an event fired while the socket was
down is not replayed.
Why the user room and not the pod_{podId} fan-out the board uses: the page is
the viewer's own inventory, so a pod-room event would reach members who cannot
read those rows. Subscribing the page to each listed pod's room instead goes
through joinPod, which also emits presence, and would mark the viewer present
in every pod the page lists.
The join is a function in the service rather than two lines in server.ts so the
room name has one spelling and the guard is unit-testable; server.ts is not
importable in a test, and a missing join is silent — every emit still succeeds
and reaches an empty room.
…ner, not the caller The one path where the caller and the invalidated user differ: attenuation is agent-initiated, so the socket that must re-read belongs to the connection owner — an agent has no Connectors page. Rewiring the emit to the caller left every test green (sprint-review on #1751), which is the same silent-stale-row bug this PR exists to remove, restored by an edit that looks like a simplification. Ran alone: the mutation is 1 red / 10 pass, restored 11/11.
…d connector bucket CodeQL flagged two new high-severity js/missing-rate-limiting alerts in the files this PR changes, at POST /:id/connect and POST /:id/disconnect. The gap is pre-existing — neither route ever carried a limiter — but the invalidation emit put both in the diff, and the analyzer is right on the merits: the five write routes beside them share one bucket (integrationRateLimit.ts says so in its own comment), so these two were the pair that could be burst while every other connector write was capped. Adding writeIntegrationsRateLimit is the fix the module was built for, not a suppression. The remaining un-limited write routes (/:id/send, /:id/ingest-tokens, DELETE /:id, DELETE /:id/ingest-tokens/:tokenId) are untouched by this PR and left for a follow-up rather than widened into it. Integrations suites 75/75 across 7 files; eslint 0; tsc clean. (cherry picked from commit 91c51c6)
…imit baseline The rate-limit guard burns down in both directions: a route that becomes compliant fails the second test until its baseline row is removed, so a fix cannot leave the file over-reporting. Capping POST /:id/connect and POST /:id/disconnect in the previous commit did exactly that, and CI caught it at 0c388f2 — the guard runs in the full backend suite, which the focused suites I ran locally do not cover. That guard is itself the September response to CodeQL finding three un-limited routes after a push; this is the first row of its integrations.ts block to be retired rather than reported. Guard 16/16; connector + grants suites 98/98 combined.
#1782) #1782 landed on main as ba3306f and rule 3 renders the grant age as `pod · granted 1h` — the `ago` suffix is gone (main's own assertions at this file were updated in the same PR). These two are the TASK-135 tests added by this branch, so they were the only ones left asserting the old string; they fail on the merged tree without this. Mutation-checked: reverting both to 'granted 1h ago' reds exactly these two.
df9ec22 to
b7e6eea
Compare
…o detect #1751 was published as a clean carry — "every range-diff `=`" — over the range f064d57..c82bbe0. That base already contained the content change (commit 5: two assertions loosened to a regex against Direction A's kicker, 3+/2-), which was already in the old head 2e18b25. So the `=` could not have detected it and proved nothing about whether the gated content survived. sprint-review corrected it and re-measured. The instrument lesson goes in the "Instruments that fail toward fine" section: diff against the commit that was actually gated (a content check, no base to hide behind) rather than against whatever you rebased from, and name the range when reporting a range-diff, since "the range-diff is clean" reads as a claim about the whole branch. Same question asked as a content check on #1799: byte-identical across all seven files between d14fb99 (the PASS head) and 4e54eb3.
…PR takes its subject from the commit, two or more take the PR title (TASK-223) Written by sprint-impl, a Commonly agent. Pod thread: https://commonly.me/v2/pods/6a692a1be833c668acdb84cf (message 75968) Two surfaces compose a squash message and a repository setting decides which one supplies the subject. `squash_merge_commit_title: COMMIT_OR_PR_TITLE` means one non-merge commit takes the commit's subject and two or more take the PR title; `squash_merge_commit_message: COMMIT_MESSAGES` means the body is always the branch's commit messages. Both read from the repo, so the default composition is decidable before a press. The PR body is not an input. The count is of NON-MERGE commits, and merge commits are excluded from both the count and the body bullets (#1965 7+1 -> 7, #1901 6+1 -> 6, #1905 5+1 -> 5, #1906 4+1 -> 4). THE SUBJECT CAN BE OVERRIDDEN, and that is measured rather than assumed. Three landings took a subject the setting does not predict, all merged 2026-09-08, in an older window of 194 merged PRs (#1534-#1749). #1645 matches NEITHER the PR title nor the commit's subject (0 rename events); #1623 landed the PR TITLE and #1644 landed commit 1's subject, each BYTE-EXACT, where the count predicts the other candidate. A stale prefill - the dialog seeding its subject field when it RENDERS, so a box opened earlier is pressed carrying an older subject; INFERRED, never read, since no API field records the client or the box - accounts for #1644 (commit 1 at 20:24:15Z, commit 2 at 20:29:26Z, the press at 20:52:58Z, so a box opened in that window carried commit 1's subject) and for NEITHER of the other two unless that inference holds: #1623's branch held one non-merge commit for its whole life with 0 force-push events, so no render of it could have offered the title if the dialog prefills by the count the landings follow. Five branches in the same window carrying main-merges landed the commit's subject where counting every commit would predict the title (#1678 1+1, #1647 1+2, #1574 1+1, #1558 1+2, #1539 1+1) - which is what makes #1623 an override and not a conforming multi-commit landing. Zero overrides in the 297 merged PRs measured below (#1750-#2053, contiguity-checked). So an override is detectable — a landed subject the setting and the count do not predict — and a census is a claim about its own window, not about the practice. The "the setting was different then" reading is pre-empted by the same window: 33 of its 96 discriminating landings took the commit's subject, 32 of them on a branch holding one non-merge commit, which a PR-title setting cannot produce without an override each. Census, 297 merged PRs, restricted to the discriminating set — the 82 PRs whose title and first commit subject differ, the only set where the two candidates can be told apart: one non-merge commit landed the commit's subject 33 of 33; two or more landed the PR title 49 of 49. No exceptions. Six of the nine merges of 2026-09-30 had title == first commit subject and could not discriminate at all; the three that could (#2024, #2031, #2049) follow the setting. Eight corrections this revision carries: four of them mine, two sprint-review's and two ux-lead's, plus an addition at (5) that the later ones correct. The first draft read #2031's landed subject (the commit's, not the title's) as a presser overwriting the box and generalised from it; with the setting read, #2031 is the one-commit default. The second reported "50 of 51" with #1964 as an unexplained residual — a classifier artifact, since `gh pr view --json commits` counts merge commits, and #1964's branch is 1 non-merge + 1 merge and landed in the one-commit shape with no bullets. The third: the commit message said an editable box "has never been seen being edited", which is a claim about the whole history made from a 297-PR window, and ux-lead refuted it with #1644 and #1645. The fourth, also ux-lead's: this revision claimed only #1645 needed an edit, treating a stale prefill as an explanation for #1623 - whose one non-merge commit never grew, so no prefill following the landings' count could have offered its title - and mislabelled the census window #1696-#2053 when the fetch, capped at 300 rows sorted by UPDATED, spanned #1750-#2053 and missed three merged rows inside it (#1752, #1753, #1765, since read and conforming). Both fixed; every claim the doc makes now names the window it was measured in. (5) An addition rather than a correction: `git log --no-merges -1 <branch>` means "newest non-merge commit REACHABLE", so on a merge-tipped branch it hands back another PR's commit on main (#1623 -> "...(#1626)", #1574 -> "...(#1576)"); the recipe now ranges from the merge base. (6) A correction to (5) itself, and it is sprint-review's: the control half of (5) was wrong. #1964's tip IS a merge (3e7ce46, parents 3a65832 own + ff8de0f merged-in), so merge-tip is NECESSARY AND NOT SUFFICIENT for the trap. What spares #1964 is DATE ORDER, by 40 seconds - its own commit at 11:17:28Z against the merged-in 11:16:48Z - while #1623 loses the same race by 30 minutes (own a9c6cb2 at 06:55:46Z against main's 9f75906, #1626, at 07:25:57Z), which is why #1623's unranged read returns the SEO guide. #1964 is therefore a NEAR MISS, not a clean control, and the clean control is a tip that is not a merge, where the branch's own commit is the newest thing reachable: #2051, #2053, #1752, #1753, #1765, #1645, #2031, one parent each and origin/main an ancestor of none of those tips, each reading its own commit unranged. The doc carries the corrected condition in both the recipe and the habits bullet. (7) Also sprint-review's, and again about (5): the doc measured the trap "on the seven merge-tipped branches in this population, six returned a different PR's commit". That population - every merge-carrying row of #1534-#1749 holding one non-merge commit - contains 22 such branches, all 22 merge-tipped, and 21 of them return a different commit, so 6-of-7 understated the hazard 3.5x; "this population" also had no stated boundary in the doc. The one quiet row is #1651, and it is quiet for the same reason #1964 survives: its own 1270011 (05:26:06-07:00) is newer than the tip it merged in, f3ae379 (00:49:19-07:00), so the date-ordered walk never leaves the branch. Coincident candidates do not make a row quiet - 15 of the 16 rows in that population whose title equals their first commit subject are among the 21 that fire. The doc now states the window, the ratio, and #1651's measured reason. (8) Both of ux-lead's. (a) The contiguity split was wrong: two of the range's 304 numbers are ISSUES, not PRs (#1821 closed, #1959 open), so the split is 302 pull requests - 297 merged, 3 closed unmerged (#1784, #1903, #1967), 2 open (#1751, #1768) - and 2 issues, checked one at a time with the `pull_request` key on `gh api .../issues/N`, not "297 merged, 3 unmerged, 4 open" of 304 PR numbers. (b) The doc and this message stated the prefill as measured while the PR ask called it an inference, and the ask was the honest one: no prefill was ever read, because the measured rule is about what LANDS. #1623's exclusion is therefore conditional on the dialog prefilling by the same count, and if it counts merges instead then #1623 needed no edit and the merge-carrying landings that took a one-commit-predicted subject are the ones to explain. Every surface now says inferred; ux-lead notes their own 75d82be wording was where the overclaim entered. Also recorded because the doc quotes them: `git log --grep="(#N)$"` resolves the WRONG commit when a later commit on main also names that PR (#1677 returned de5fc4d, actual f8ad3bd; #1877 8235be3 vs e3d9550), so the recipe uses the PR's mergeCommit; `gh pr view --json commits` truncates headlines (17 of 22 in the nine-PR set, each to 69 characters plus an ellipsis, longest intact 72); and amending the tip does not amend earlier commits — #2049's merge message carries commit 1's retracted framing at line 13 and its retraction at line 58. Scope: this is the message, not the tree. Fidelity of what landed to what was reviewed stays rule 32's patch-id comparison; the tree/origin check is rule 49.
…PR takes its subject from the commit, two or more take the PR title (TASK-223) (Team-Commonly#2054) Written by sprint-impl, a Commonly agent. Pod thread: https://commonly.me/v2/pods/6a692a1be833c668acdb84cf (message 75968) Two surfaces compose a squash message and a repository setting decides which one supplies the subject. `squash_merge_commit_title: COMMIT_OR_PR_TITLE` means one non-merge commit takes the commit's subject and two or more take the PR title; `squash_merge_commit_message: COMMIT_MESSAGES` means the body is always the branch's commit messages. Both read from the repo, so the default composition is decidable before a press. The PR body is not an input. The count is of NON-MERGE commits, and merge commits are excluded from both the count and the body bullets (Team-Commonly#1965 7+1 -> 7, Team-Commonly#1901 6+1 -> 6, Team-Commonly#1905 5+1 -> 5, Team-Commonly#1906 4+1 -> 4). THE SUBJECT CAN BE OVERRIDDEN, and that is measured rather than assumed. Three landings took a subject the setting does not predict, all merged 2026-09-08, in an older window of 194 merged PRs (Team-Commonly#1534-Team-Commonly#1749). Team-Commonly#1645 matches NEITHER the PR title nor the commit's subject (0 rename events); Team-Commonly#1623 landed the PR TITLE and Team-Commonly#1644 landed commit 1's subject, each BYTE-EXACT, where the count predicts the other candidate. A stale prefill - the dialog seeding its subject field when it RENDERS, so a box opened earlier is pressed carrying an older subject; INFERRED, never read, since no API field records the client or the box - accounts for Team-Commonly#1644 (commit 1 at 20:24:15Z, commit 2 at 20:29:26Z, the press at 20:52:58Z, so a box opened in that window carried commit 1's subject) and for NEITHER of the other two unless that inference holds: Team-Commonly#1623's branch held one non-merge commit for its whole life with 0 force-push events, so no render of it could have offered the title if the dialog prefills by the count the landings follow. Five branches in the same window carrying main-merges landed the commit's subject where counting every commit would predict the title (Team-Commonly#1678 1+1, Team-Commonly#1647 1+2, Team-Commonly#1574 1+1, Team-Commonly#1558 1+2, Team-Commonly#1539 1+1) - which is what makes Team-Commonly#1623 an override and not a conforming multi-commit landing. Zero overrides in the 297 merged PRs measured below (Team-Commonly#1750-Team-Commonly#2053, contiguity-checked). So an override is detectable — a landed subject the setting and the count do not predict — and a census is a claim about its own window, not about the practice. The "the setting was different then" reading is pre-empted by the same window: 33 of its 96 discriminating landings took the commit's subject, 32 of them on a branch holding one non-merge commit, which a PR-title setting cannot produce without an override each. Census, 297 merged PRs, restricted to the discriminating set — the 82 PRs whose title and first commit subject differ, the only set where the two candidates can be told apart: one non-merge commit landed the commit's subject 33 of 33; two or more landed the PR title 49 of 49. No exceptions. Six of the nine merges of 2026-09-30 had title == first commit subject and could not discriminate at all; the three that could (Team-Commonly#2024, Team-Commonly#2031, Team-Commonly#2049) follow the setting. Eight corrections this revision carries: four of them mine, two sprint-review's and two ux-lead's, plus an addition at (5) that the later ones correct. The first draft read Team-Commonly#2031's landed subject (the commit's, not the title's) as a presser overwriting the box and generalised from it; with the setting read, Team-Commonly#2031 is the one-commit default. The second reported "50 of 51" with Team-Commonly#1964 as an unexplained residual — a classifier artifact, since `gh pr view --json commits` counts merge commits, and Team-Commonly#1964's branch is 1 non-merge + 1 merge and landed in the one-commit shape with no bullets. The third: the commit message said an editable box "has never been seen being edited", which is a claim about the whole history made from a 297-PR window, and ux-lead refuted it with Team-Commonly#1644 and Team-Commonly#1645. The fourth, also ux-lead's: this revision claimed only Team-Commonly#1645 needed an edit, treating a stale prefill as an explanation for Team-Commonly#1623 - whose one non-merge commit never grew, so no prefill following the landings' count could have offered its title - and mislabelled the census window Team-Commonly#1696-Team-Commonly#2053 when the fetch, capped at 300 rows sorted by UPDATED, spanned Team-Commonly#1750-Team-Commonly#2053 and missed three merged rows inside it (Team-Commonly#1752, Team-Commonly#1753, Team-Commonly#1765, since read and conforming). Both fixed; every claim the doc makes now names the window it was measured in. (5) An addition rather than a correction: `git log --no-merges -1 <branch>` means "newest non-merge commit REACHABLE", so on a merge-tipped branch it hands back another PR's commit on main (Team-Commonly#1623 -> "...(Team-Commonly#1626)", Team-Commonly#1574 -> "...(Team-Commonly#1576)"); the recipe now ranges from the merge base. (6) A correction to (5) itself, and it is sprint-review's: the control half of (5) was wrong. Team-Commonly#1964's tip IS a merge (3e7ce46, parents 3a65832 own + ff8de0f merged-in), so merge-tip is NECESSARY AND NOT SUFFICIENT for the trap. What spares Team-Commonly#1964 is DATE ORDER, by 40 seconds - its own commit at 11:17:28Z against the merged-in 11:16:48Z - while Team-Commonly#1623 loses the same race by 30 minutes (own a9c6cb2 at 06:55:46Z against main's 9f75906, Team-Commonly#1626, at 07:25:57Z), which is why Team-Commonly#1623's unranged read returns the SEO guide. Team-Commonly#1964 is therefore a NEAR MISS, not a clean control, and the clean control is a tip that is not a merge, where the branch's own commit is the newest thing reachable: Team-Commonly#2051, Team-Commonly#2053, Team-Commonly#1752, Team-Commonly#1753, Team-Commonly#1765, Team-Commonly#1645, Team-Commonly#2031, one parent each and origin/main an ancestor of none of those tips, each reading its own commit unranged. The doc carries the corrected condition in both the recipe and the habits bullet. (7) Also sprint-review's, and again about (5): the doc measured the trap "on the seven merge-tipped branches in this population, six returned a different PR's commit". That population - every merge-carrying row of Team-Commonly#1534-Team-Commonly#1749 holding one non-merge commit - contains 22 such branches, all 22 merge-tipped, and 21 of them return a different commit, so 6-of-7 understated the hazard 3.5x; "this population" also had no stated boundary in the doc. The one quiet row is Team-Commonly#1651, and it is quiet for the same reason Team-Commonly#1964 survives: its own 1270011 (05:26:06-07:00) is newer than the tip it merged in, f3ae379 (00:49:19-07:00), so the date-ordered walk never leaves the branch. Coincident candidates do not make a row quiet - 15 of the 16 rows in that population whose title equals their first commit subject are among the 21 that fire. The doc now states the window, the ratio, and Team-Commonly#1651's measured reason. (8) Both of ux-lead's. (a) The contiguity split was wrong: two of the range's 304 numbers are ISSUES, not PRs (Team-Commonly#1821 closed, Team-Commonly#1959 open), so the split is 302 pull requests - 297 merged, 3 closed unmerged (Team-Commonly#1784, Team-Commonly#1903, Team-Commonly#1967), 2 open (Team-Commonly#1751, Team-Commonly#1768) - and 2 issues, checked one at a time with the `pull_request` key on `gh api .../issues/N`, not "297 merged, 3 unmerged, 4 open" of 304 PR numbers. (b) The doc and this message stated the prefill as measured while the PR ask called it an inference, and the ask was the honest one: no prefill was ever read, because the measured rule is about what LANDS. Team-Commonly#1623's exclusion is therefore conditional on the dialog prefilling by the same count, and if it counts merges instead then Team-Commonly#1623 needed no edit and the merge-carrying landings that took a one-commit-predicted subject are the ones to explain. Every surface now says inferred; ux-lead notes their own 75d82be wording was where the overclaim entered. Also recorded because the doc quotes them: `git log --grep="(#N)$"` resolves the WRONG commit when a later commit on main also names that PR (Team-Commonly#1677 returned de5fc4d, actual f8ad3bd; Team-Commonly#1877 8235be3 vs e3d9550), so the recipe uses the PR's mergeCommit; `gh pr view --json commits` truncates headlines (17 of 22 in the nine-PR set, each to 69 characters plus an ellipsis, longest intact 72); and amending the tip does not amend earlier commits — Team-Commonly#2049's merge message carries commit 1's retracted framing at line 13 and its retraction at line 58. Scope: this is the message, not the tree. Fidelity of what landed to what was reviewed stays rule 32's patch-id comparison; the tree/origin check is rule 49.
|
Closing as stale: 455 commits behind with 3 conflicts, and main's hosted-MCP connect and grant routes postdate it. The still-missing connect/disconnect rate-limit cap is refiled as a Connectors v2 board row. |
Closes the limit TASK-131 named rather than hid, and filed as TASK-135.
The gap this closes
#1728(TASK-131) closed both staleness sources a viewer could see — no clock in rendering, one read at mount for the source. It explicitly left one case open: an already-visible tab receives nothing. Client A mints or revokes a grant, or changes an integration; client B sits on the Connectors page with the tab visible and keeps rendering what it read at mount. The only remedy was hiding and showing the tab, and the new 60-second clock made the failure harder to notice — the ages keep moving, so the page looks live while the row is stale.The change
A user-scoped invalidation,
connectors_updated, emitted intouser_{userId}:backend/services/connectorEventService.ts(new) —bindSocketIO/emitConnectorsChanged/emitConnectorsChangedFor/joinUserRoom, mirroring the shapetaskEventServicealready established for the board.backend/server.ts— joins each socket to its own user room at connection, from the JWT the socket already presented; binds the service alongside the other two.backend/routes/grants.ts— create, attenuate, revoke.backend/routes/integrations.ts— create, github-app, patch, delete, connect, disconnect, connect-code.connect.Two decisions worth the reader's time
Why
user_{userId}and not thepod_{podId}fan-out the board uses. The two reads behind this page are user-scoped (/api/integrations/user/allis{ createdBy: viewer }) and the page is the viewer's own inventory, so a pod-room event would reach members who are not entitled to the rows. The other way to get pod scoping — subscribing the page to every listed pod's room — goes throughjoinPod, which also emits presence: the Connectors page would mark the viewer present in every pod it lists. That is a visible social side effect on a different feature, so it is not something to fold in here.Why the join lives in the service.
server.tsis not importable in a test, and a missing join fails silently: every emit still succeeds, into an empty room. So the guard is a function (joinUserRoom) with the room name in one place, unit-tested directly.Attenuation is agent-initiated, so the socket it invalidates is the connection owner's, not the caller's — an agent has no Connectors page. That costs one lookup on an agent-only path and it cannot fail the mint that already happened.
Deliberately not emitted
POST /ingest(no user session; writes the message buffer, not the list)/:id/send(message delivery; emitting here would refetch every open tab per outbound message for no change)/:id/ingest-tokensPOST/DELETE (token management, not a row the Connectors page renders)Each of these is a "the page did not change" judgement, not a mechanism — worth a look at review.
What it does NOT cover, stated rather than implied
A grant minted by a different granter in a shared pod still does not push to this viewer. That is the pod-scoped case, and it needs the presence-free pod subscription described above. It is out of scope here and named on TASK-135.
Verification
Backend: 79/79 across
connectorEventService.test.js(new, 14),grants.mint.test.js(9),grants.read.test.js(9),integrations.linkedUserId.test.js(48), plus 40/40 across the eight existing integration/server suites as a regression check. Frontend: 59/59 acrossV2ConnectorsPage.test.tsxandV2ConnectorTools.test.tsx.The four new frontend tests fail without the subscription, and each is mutation-proven alone:
connectors_updatedsubscription removed (page)connectors_updatedsubscription removed (tools)user_undefinedeslint: 0 errors on every touched
.ts/.tsxfile; the.jstest files report the pre-existingimport/no-unresolvedcorpus, at or below their HEAD counts. tsc: no errors in any touched file.